﻿using System;
using System.Linq;

namespace Clover.BaseAuth
{
    public class CustomPermissionAttribute : Attribute, IPermissionAttribute
    {
        public Enum[] Permissions { get; set; }

        public CustomPermissionAttribute(Permission permission)
        {
            Permissions = new Enum[] { permission };
        }
        public CustomPermissionAttribute(Permission permission, Permission permission1)
        {
            Permissions = new Enum[] {permission, permission1 };
        }
        public CustomPermissionAttribute(Permission permission, Permission permission1, Permission permission2)
        {
            Permissions = new Enum[] { permission, permission1,permission2 };
        }
        public CustomPermissionAttribute(params Permission[] permissions)
        {
            Permissions = permissions.Select(m=> m as Enum).ToArray();
        }
    }
}
